/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.ChartTools;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

/**
 * 
 * @author Bunkowski
 */
public class legendItemEditorPopup extends JPopupMenu {

	public static final long serialVersionUID = 1L;

	private XYSeriesCollection col;
	private XYSeries s;

	public legendItemEditorPopup(XYSeriesCollection col, XYSeries s) {
		this.col = col;
		this.s = s;
		init();
	}

	private void init() {
		JMenuItem delete = new JMenuItem("Delete");
		add(delete);
		delete.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				deleteActionPerformed();
			}
		});
	}

	private void deleteActionPerformed() {
		col.removeSeries(s);
	}
}
